<template>
  <div>
    <div class="app-container">
      <Header title="设置" class="app-container" />

      <!-- <div>&nbsp;&nbsp;</div> -->

      <mt-cell title="修改密码" to="/app/changePsw" is-link>
        <!-- <img slot="icon" :src="partner.image" width="24" height="24" /> -->
      </mt-cell>
      <mt-cell title="重置密码" to="/app/resetpsw" is-link>
        <!-- <img slot="icon" :src="partner.image" width="24" height="24" /> -->
      </mt-cell>
      <mt-cell title="关于国医" is-link @click.native="handleAbout">
        <!-- <img slot="icon" :src="partner.image" width="24" height="24" /> -->
      </mt-cell>
      <mt-cell title="切换身份" is-link @click.native="handleAbout">
        {{ isEmployee }}
      </mt-cell>

      <mt-button
        align="center"
        class="el-icon-plus"
        @click.native="handleLogout"
      >
        退出登录
      </mt-button>
      <div>
        <!-- {{ partner }} -->
      </div>
    </div>
  </div>
</template>

<script>
import Header from '@/components3/Header'

export default {
  name: 'MeConsultant',
  components: { Header },
  directives: {},
  filters: {},
  // mixins: [],
  props: {},

  data() {
    return {}
  },
  computed: {
    isEmployee: function() {
      console.log('xxxxx, this.$store.state.appMe', this.$store.state.appMe)

      return this.$store.state.appMe.isEmployee ? '大夫' : '患者'
    }
  },
  async created() {
    //
  },

  methods: {
    handleChangePsw() {
      console.log('xxx, click handleChangePsw,')
    },
    handleAbout() {
      console.log('xxx, click  about,')
    },
    async handleLogout() {
      console.log('xxx,handleLogout')
      await this.$store.dispatch('user/logout')
      console.log('xxx,handleLogout 2')
      this.$store.dispatch('appView/selectHome', 'home')
      this.$router.push('/app/login')
    }
  }
}
</script>

<style type="text/css"></style>
